program eraseSims

    use iasing_osse
    use netcdf

    implicit none

    integer :: dbid
    type(r4a_ids) :: db_ids
    integer :: natm, nocl
    real(JPR4), dimension(:,:), allocatable :: rad
    character(len=128) :: arg

    include "checknc.interface"
    include "r60_initializer.interface"

    call get_command_argument(1, arg)
    call checknc(nf90_open(arg, NF90_WRITE, dbid))
    db_ids = r60_initializer(dbid)

    call checknc(nf90_inquire_dimension(dbid, db_ids%atm_did, len=natm))
    call checknc(nf90_inquire_dimension(dbid, db_ids%ocl_did, len=nocl))

    allocate(rad(NIASI, natm))
    rad = -999.9
    call checknc(nf90_put_var(db_ids%rbt%gid, db_ids%rbt%ria, rad))
    deallocate(rad)

    allocate(rad(NIANG,natm))
    rad = -999.9
    call checknc(nf90_put_var(db_ids%rbt%gid, db_ids%rbt%rng, rad))
    call checknc(nf90_put_var(db_ids%rbt%gid, db_ids%rbt%ngb, rad))
    deallocate(rad)

    allocate(rad(nocl, natm))
    rad = -999.9
    call checknc(nf90_put_var(db_ids%obs%gid, db_ids%obs%ofd, rad))
    call checknc(nf90_put_var(db_ids%obs%gid, db_ids%obs%obi, rad))
    deallocate(rad)


    call checknc(nf90_close(dbid))


end program

